//
//  xsSelectAddMaterialView.m
//  digital_robot_demo
//
//  Created by xskj on 2024/8/29.
//  选择添加素材
// @[@"全部",@"图片",@"视频"]

#import "xsSelectAddMaterialView.h"
  
#define xrandomColor  [UIColor colorWithRed:(arc4random() %255)/255.0f green:(arc4random() %255)/255.0f blue:(arc4random() %255)/255.0f alpha:1.0f]

@interface xsSelectAddMaterialView()<UIScrollViewDelegate,xsSelectAddMaterialCollectionViewProtoCol>

//@property (nonatomic,assign)NSInteger collectionType;
@property (nonatomic, strong) UIView *topView;
@property (nonatomic, strong) UIButton *searchButton;
@property (nonatomic, strong) UILabel *topTitleLabel;
@property (nonatomic, strong) UIButton *xsXbutton;// x按钮


@property (nonatomic, strong) UIScrollView *buttonsBgScrollView;
@property (nonatomic, strong) NSArray *buttons;
@property (nonatomic, strong) UIView *buttonsBgView;

@property (nonatomic,strong)UIScrollView *myMusicAuthorityBgScrollView;
@property (nonatomic,strong)xsSelectAddMaterialCollectionView *allCollectionV;// 全部
@property (nonatomic,strong)xsSelectAddMaterialCollectionView *xsImgCollectionV;// 图片
@property (nonatomic,strong)xsSelectAddMaterialCollectionView *xsVideoCollectionV;//视频

@property (nonatomic,strong) UIView *xsColorContourLineView;

@end

@implementation xsSelectAddMaterialView



- (instancetype)initWithButtonTitles:(NSArray *)buttonTitles{
    
    if (self = [super init]) {
        self.backgroundColor = UIColor.blackColor;
        
//        self.collectionType = collectionType;
        [self addSubview:self.topView];
        
        [self.topView addSubview:self.searchButton];
        [self.topView addSubview:self.topTitleLabel];
        [self.topView addSubview:self.xsXbutton];
        
        [self addSubview:self.buttonsBgScrollView];
            
        [self.buttonsBgScrollView addSubview:self.buttonsBgView];
        [self.buttonsBgView addSubview:self.xsColorContourLineView];
        
//
        [self addSubview:self.myMusicAuthorityBgScrollView];
        
        [self.myMusicAuthorityBgScrollView addSubview:self.allCollectionV];
        [self.myMusicAuthorityBgScrollView addSubview:self.xsImgCollectionV];
        [self.myMusicAuthorityBgScrollView addSubview:self.xsVideoCollectionV];
            
            // 创建按钮数组
        self.buttons = buttonTitles;//@[@"Tab1", @"Tab2", @"Tab3"];
            
          
        
    }
    return self;
}


- (UIView *)buttonsBgView{
    if(!_buttonsBgView){
        _buttonsBgView = [[UIView alloc] init];
        _buttonsBgView.backgroundColor = UIColor.blackColor;
    }
    return _buttonsBgView;
}


//@property (nonatomic,strong) UIScrollView *buttonsBgScrollView;
//[self.bgView addSubview:self.buttonsBgScrollView];
//[self.buttonsBgScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
//    make.edges.equalTo(self.bgView);
//}];
- (UIScrollView *)buttonsBgScrollView
{
    if(!_buttonsBgScrollView){
        _buttonsBgScrollView = [[UIScrollView alloc] init];
        _buttonsBgScrollView.backgroundColor = UIColor.clearColor;
        
        _buttonsBgScrollView.delegate = self;
        _buttonsBgScrollView.pagingEnabled = YES;
        _buttonsBgScrollView.showsHorizontalScrollIndicator = NO;
    }
    return _buttonsBgScrollView;
}



-(void)layoutSubviews{
    [super layoutSubviews];
    //_recorder.preViewLayer.frame = self.frame;
    
    NSLog(@"layoutSubviews--self.bounds==%@",NSStringFromCGRect(self.bounds));
    
    
}


- (void)xsChangeFrame{
    
    CGFloat margin10 = 10;
    [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(margin10);
        make.top.equalTo(self.mas_top);//.offset(10);
        make.right.equalTo(self.mas_right).offset(-margin10);
        make.height.mas_equalTo(50);
    }];
    
    [self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.topView.mas_left);//.offset(10);
        make.centerY.equalTo(self.topView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(35, 35));
    }];
    
    [self.xsXbutton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.topView.mas_right);//.offset(10);
        make.centerY.equalTo(self.topView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(35, 35));
    }];
    
    [self.topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.topView);
    }];
    
    
    
    self.buttonsBgScrollView.frame = CGRectMake(0, 50+margin10, self.bounds.size.width, 40);
    
    
//    [self.allCollectionV mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.mas_left).offset(margin10);
//        make.top.equalTo(self.buttonsBgScrollView.mas_bottom).offset(margin10);
//        make.right.equalTo(self.mas_right).offset(-margin10);
//        make.bottom.equalTo(self.mas_bottom).offset(-margin10);
//    }];
    CGFloat myMusicAuthorityBgScrollViewY = CGRectGetMaxY(self.buttonsBgScrollView.frame)+margin10;
    CGFloat myMusicAuthorityBgScrollViewX = margin10;
    CGFloat myMusicAuthorityBgScrollViewW = self.width-myMusicAuthorityBgScrollViewX*2.0;
    CGFloat myMusicAuthorityBgScrollViewH = self.height - myMusicAuthorityBgScrollViewY-10;
    self.myMusicAuthorityBgScrollView.frame = CGRectMake(myMusicAuthorityBgScrollViewX, myMusicAuthorityBgScrollViewY, myMusicAuthorityBgScrollViewW, myMusicAuthorityBgScrollViewH);
    self.myMusicAuthorityBgScrollView.backgroundColor = UIColor.clearColor;
    
    
    self.allCollectionV.frame = CGRectMake(0, 0, self.myMusicAuthorityBgScrollView.width, self.myMusicAuthorityBgScrollView.height);
    self.xsImgCollectionV.frame = CGRectMake(self.myMusicAuthorityBgScrollView.width, 0, self.myMusicAuthorityBgScrollView.width, self.myMusicAuthorityBgScrollView.height);
    self.xsVideoCollectionV.frame = CGRectMake(self.myMusicAuthorityBgScrollView.width*2.0, 0, self.myMusicAuthorityBgScrollView.width, self.myMusicAuthorityBgScrollView.height);
    
    self.myMusicAuthorityBgScrollView.contentSize = CGSizeMake(self.myMusicAuthorityBgScrollView.width*3, 0);
    
    UIFont *btnFont = Font(16);
    
    
    UIButton *lastButton;
    // 添加按钮到滚动视图
    for (int i = 0; i < self.buttons.count; i++) {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        
        NSString *buttonTitleStr = self.buttons[i];
        
        CGFloat buttonW = [buttonTitleStr calculateWidth:btnFont withHeight:40]+25.0;
        
//        button.frame = CGRectMake(i * buttonW, 0, buttonW, 40);
       
        button.backgroundColor = UIColor.clearColor;//xrandomColor;
        [button setTitle:self.buttons[i] forState:UIControlStateNormal];
        [button setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
        button.font = btnFont;
        [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
        [button setTag:i];
        [self.buttonsBgView addSubview:button];
        
        
        if(lastButton){
            
            button.frame = CGRectMake(CGRectGetMaxX(lastButton.frame), 0, buttonW, 40);
            button.font = btnFont;
        }
        else{
            button.frame = CGRectMake(0, 0, buttonW, 40);
            
            CGFloat xsColorContourLineViewX = CGRectGetMinX(button.frame)+(buttonW-30.0)*0.5;
            [self.xsColorContourLineView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.bottom.equalTo(button.mas_bottom);
                make.left.equalTo(self.buttonsBgView.mas_left).offset(xsColorContourLineViewX);
                make.height.mas_equalTo(3.0);
                make.width.mas_equalTo(30.0);
            }];
            self.xsColorContourLineView.layer.cornerRadius = 1.51;
            self.xsColorContourLineView.layer.masksToBounds = YES;
            button.font = FontBoldMT(16);
        }
        lastButton = button;
    }

    // 设置内容视图的尺寸
    self.buttonsBgView.frame = CGRectMake(0, 0, CGRectGetMaxX(lastButton.frame), 40);
    self.buttonsBgScrollView.contentSize = self.buttonsBgView.frame.size;
}

- (void)buttonClicked:(UIButton *)sender {
    NSInteger selectedIndex = sender.tag;
    NSLog(@"Selected index: %ld", (long)selectedIndex);
    
    // 在这里切换底部视图
    
    
//    if(selectedIndex==0){// 我的
//        
//    }
//    else{// 官方
//
//    }
    
    CGFloat xsColorContourLineViewX = CGRectGetMinX(sender.frame)+(sender.width-30.0)*0.5;
    for (UIButton *tempButton in self.buttonsBgView.subviews) {
        if([tempButton  isKindOfClass:[UIButton class]]){
            if(tempButton.tag!=sender.tag){
                tempButton.font = Font(16);
            }
            else{
                tempButton.font = FontBoldMT(16);
            }
        }
    }
    
    
    //CGFloat xsColorContourLineViewX2 = CGRectGetMinX(sender.frame)+(sender.width-30.0)*0.5;
    
    
    XSWeakSelf;
    [UIView animateWithDuration:0.3 animations:^{
//        [weakSelf.xsColorContourLineView mas_updateConstraints:^(MASConstraintMaker *make) {
//            make.left.equalTo(weakSelf.buttonsBgView.mas_left).offset(xsColorContourLineViewX);
//        }];
        [weakSelf.xsColorContourLineView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(sender.mas_bottom);
            make.left.equalTo(self.buttonsBgView.mas_left).offset(xsColorContourLineViewX);
            make.height.mas_equalTo(3.0);
            make.width.mas_equalTo(30.0);
        }];
        
        [weakSelf.myMusicAuthorityBgScrollView setContentOffset:CGPointMake(weakSelf.myMusicAuthorityBgScrollView.width*selectedIndex, 0)];
    }];
    
}

- (void)updateConstraints{
    [super updateConstraints];
//    
//    __weak __typeof (&*self)weakSelf = self;
    
    NSLog(@"updateConstraints");
    
    
    
    
}


- (xsSelectAddMaterialCollectionView *)allCollectionV{
    
    if(!_allCollectionV){
        
        UICollectionViewFlowLayout *la = [[UICollectionViewFlowLayout alloc] init];
        // 3. 横向间距
        la.minimumInteritemSpacing = 5.0;
        // 4. 纵向间距
        la.minimumLineSpacing = 5.0;
        
//        NSArray *tempArr = @[@"温柔妹子",@"开朗小杰",@"萌丫头",@"鸡汤妹妹",@"温柔晓晓",@"温柔妹子",@"开朗小杰",@"萌丫头",@"鸡汤妹妹",@"温柔晓晓"];
//        
//        NSMutableArray *tempMarr = [NSMutableArray new];
//        for (int i =0; i<30; i++) {
//            xsSelectAddMaterialCollectionViewCellModel *md = [xsSelectAddMaterialCollectionViewCellModel new];
//            
//            int tpIndex = arc4random()%(tempArr.count);
//            md.titleString = [NSString stringWithFormat:@"%@",tempArr[tpIndex]];
//            md.headImg = @"bossIPDefaultImage";
//            [tempMarr addObject:md];
//        }
//        
        //collectionType;// 0全部 1图片 2视频
        _allCollectionV = [[xsSelectAddMaterialCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:la withCollectionType:0];
        _allCollectionV.backgroundColor = UIColor.blackColor;
        _allCollectionV.delegateConfigurationMusic = self;
        
    }
    return _allCollectionV;
}


- (xsSelectAddMaterialCollectionView *)xsImgCollectionV{
    
    if(!_xsImgCollectionV){
        
        UICollectionViewFlowLayout *la = [[UICollectionViewFlowLayout alloc] init];
        // 3. 横向间距
        la.minimumInteritemSpacing = 5.0;
        // 4. 纵向间距
        la.minimumLineSpacing = 5.0;
        
//        NSArray *tempArr = @[@"温柔妹子",@"开朗小杰",@"萌丫头",@"鸡汤妹妹",@"温柔晓晓",@"温柔妹子",@"开朗小杰",@"萌丫头",@"鸡汤妹妹",@"温柔晓晓"];
//        
//        NSMutableArray *tempMarr = [NSMutableArray new];
//        for (int i =0; i<30; i++) {
//            xsSelectAddMaterialCollectionViewCellModel *md = [xsSelectAddMaterialCollectionViewCellModel new];
//            
//            int tpIndex = arc4random()%(tempArr.count);
//            md.titleString = [NSString stringWithFormat:@"%@",tempArr[tpIndex]];
//            md.headImg = @"bossIPDefaultImage";
//            [tempMarr addObject:md];
//        }
        
        ////audioType;// 0我的 1官方
        _xsImgCollectionV = [[xsSelectAddMaterialCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:la withCollectionType:3];
        _xsImgCollectionV.backgroundColor = UIColor.blackColor;
        _xsImgCollectionV.delegateConfigurationMusic = self;
        
    }
    return _xsImgCollectionV;
}

- (xsSelectAddMaterialCollectionView *)xsVideoCollectionV{
    
    if(!_xsVideoCollectionV){
        
        UICollectionViewFlowLayout *la = [[UICollectionViewFlowLayout alloc] init];
        // 3. 横向间距
        la.minimumInteritemSpacing = 5.0;
        // 4. 纵向间距
        la.minimumLineSpacing = 5.0;
        
//        NSArray *tempArr = @[@"温柔妹子",@"开朗小杰",@"萌丫头",@"鸡汤妹妹",@"温柔晓晓",@"温柔妹子",@"开朗小杰",@"萌丫头",@"鸡汤妹妹",@"温柔晓晓"];
//
//        NSMutableArray *tempMarr = [NSMutableArray new];
//        for (int i =0; i<30; i++) {
//            xsSelectAddMaterialCollectionViewCellModel *md = [xsSelectAddMaterialCollectionViewCellModel new];
//
//            int tpIndex = arc4random()%(tempArr.count);
//            md.titleString = [NSString stringWithFormat:@"%@",tempArr[tpIndex]];
//            md.headImg = @"bossIPDefaultImage";
//            [tempMarr addObject:md];
//        }
        
        ////audioType;// 0我的 1官方
        _xsVideoCollectionV = [[xsSelectAddMaterialCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:la withCollectionType:1];
        _xsVideoCollectionV.backgroundColor = UIColor.blackColor;
        _xsVideoCollectionV.delegateConfigurationMusic = self;
        
    }
    return _xsVideoCollectionV;
}

- (UIView *)topView{
    
    if(!_topView){
        _topView = [[UIView alloc] init];
        _topView.backgroundColor = UIColor.clearColor;
    }
    return _topView;
}



- (UIButton *)xsXbutton{
    if (!_xsXbutton) {
        _xsXbutton = [UIButton buttonWithType:UIButtonTypeCustom];
        _xsXbutton.backgroundColor = UIColor.clearColor;
        [_xsXbutton addTarget:self action:@selector(xsXbuttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [_xsXbutton setImage:[UIImage imageNamed:@"xsBossIPX"] forState:UIControlStateNormal];
    }
    return _xsXbutton;
}
- (void)xsXbuttonAction:(UIButton *)btn{
    NSLog(@"xsXbuttonAction\n\n");
   
    if([self.delegate respondsToSelector:@selector(xsSelectAddMaterialVXbuttonEvent:)]){
        [self.delegate xsSelectAddMaterialVXbuttonEvent:btn];
    }
}

- (UIButton *)searchButton{
    if (!_searchButton) {
        _searchButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _searchButton.backgroundColor = UIColor.purpleColor;
        [_searchButton addTarget:self action:@selector(searchButtonAction:) forControlEvents:UIControlEventTouchUpInside];
        [_searchButton setImage:[UIImage imageNamed:@"xsBossIPX"] forState:UIControlStateNormal];
        _searchButton.hidden = YES;
    }
    return _searchButton;
}
- (void)searchButtonAction:(UIButton *)btn{
    NSLog(@"searchButtonAction\n\n");
   
    
}
- (UILabel *)topTitleLabel {
    if (!_topTitleLabel) {
        _topTitleLabel = [[UILabel alloc] init];
        _topTitleLabel.backgroundColor = UIColor.clearColor;
        _topTitleLabel.font = [UIFont systemFontOfSize:21];// FontSemibold(17);
        _topTitleLabel.textColor = UIColor.whiteColor;//COLOR_TextGray9B;
        _topTitleLabel.numberOfLines = 1;
        _topTitleLabel.text = @"选择添加素材";
        _topTitleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _topTitleLabel;
}



- (UIScrollView *)myMusicAuthorityBgScrollView
{
    if(!_myMusicAuthorityBgScrollView){
        _myMusicAuthorityBgScrollView = [[UIScrollView alloc] init];
        _myMusicAuthorityBgScrollView.backgroundColor = UIColor.clearColor;
        _myMusicAuthorityBgScrollView.showsVerticalScrollIndicator = NO;
        _myMusicAuthorityBgScrollView.showsHorizontalScrollIndicator = NO;
        _myMusicAuthorityBgScrollView.pagingEnabled = YES;
        _myMusicAuthorityBgScrollView.delegate = self;
    }
    return _myMusicAuthorityBgScrollView;
}
- (UIView *)xsColorContourLineView{
    if(!_xsColorContourLineView){
        _xsColorContourLineView = [[UIView alloc] init];
        _xsColorContourLineView.backgroundColor = COLOR_White;
    }
    return _xsColorContourLineView;
}


#pragma mark  ScollViewDelegate
// 滚动视图减速完成，滚动将停止时，调用该方法。一次有效滑动，只执行一次。
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    
    NSLog(@"scrollViewDidEndDecelerating");
    if(scrollView==self.myMusicAuthorityBgScrollView){
        int pageIndex = scrollView.contentOffset.x/self.myMusicAuthorityBgScrollView.frame.size.width;
        
        NSLog(@"scrollViewDidEndDecelerating--pageIndex==%d\n",pageIndex);
        for (UIButton *tempButton in self.buttonsBgView.subviews) {
            if([tempButton isKindOfClass:[UIButton class]])
            {
                if(pageIndex==tempButton.tag){
                    [self buttonClicked:tempButton];
                    break;
                }
            }
        }
    }
}

#pragma mark xsSelectAddMaterialCollectionViewProtoCol
//collectionType;// 0全部 3图片 1视频
- (void)xsSelectAddMaterialCollectionCellBeClick:(xsSelectAddMaterialCollectionViewCellModel *)model withCollectionType:(NSInteger)collectionType{
    
//    if(collectionType==0){
//        // 图片或者视频要更新数据
//        
//        [_xsImgCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
//        
//        [_xsVideoCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
//    }
//    else if(collectionType==3){
//        // 全部要更新数据
//        
//        [_allCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
//    }
//    else if(collectionType==1){
//        // 全部要更新数据
//        [_allCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
//    }
    
    [self xsUpdataCollectionWithModel:model withCollectionType:model.collectionType];
    
    if(self.xsSelectAddMaterialCellCallbackBlock){
        self.xsSelectAddMaterialCellCallbackBlock(model,collectionType);
    }
}

//collectionType;// 0全部 3图片 1视频
- (void)xsSelectAddMaterialCollectioncellDeleteButtonBeClickBk:(xsSelectAddMaterialCollectionViewCellModel *)model withCollectionType:(NSInteger)collectionType{
    
    
    if(self.xsSelectAddMaterialCellDeleteButtonCallbackBlock){
        self.xsSelectAddMaterialCellDeleteButtonCallbackBlock(model,collectionType);
    }
}
//collectionType;// 0全部 3图片 1视频
- (void)xsUpdataMaterialWithModel:(xsSelectAddMaterialCollectionViewCellModel *)upMaterialModel  withCollectionType:(NSInteger)collectionType{
    
//    if(upMaterialModel.collectionType==0){
//        
//        [self.allCollectionV xsCollectionViewUpdataMaterialWithModel:upMaterialModel];
//    }
//    else if(upMaterialModel.collectionType==3){
//        [self.xsVideoCollectionV xsCollectionViewUpdataMaterialWithModel:upMaterialModel];
//        [self.allCollectionV xsCollectionViewUpdataMaterialWithModel:upMaterialModel];
//    }
//    else if(upMaterialModel.collectionType==1){
//        [self.xsImgCollectionV xsCollectionViewUpdataMaterialWithModel:upMaterialModel];
//        [self.allCollectionV xsCollectionViewUpdataMaterialWithModel:upMaterialModel];
//    }
    
   
    [self xsUpdataCollectionWithModel:upMaterialModel withCollectionType:collectionType];
}


- (void)xsUpdataCollectionWithModel:(xsSelectAddMaterialCollectionViewCellModel *)model withCollectionType:(NSInteger)collectionType{
    
    NSString *tempStr = [NSString stringWithFormat:@"xsUpdataCollectionWithModel--model.Id==%ld collectionType==%ld",model.Id,collectionType];
    XSLogMethod2(tempStr)
    
    //collectionType;// 0全部 3图片 1视频
    
    if(collectionType==0){
        // 全部\图片或者视频要更新数据
        
        [_xsImgCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
        [_xsVideoCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
        [_allCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
    }
    else if(collectionType==3){
        // 全部\图片要更新数据
        [_xsImgCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
        [_allCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
    }
    else if(collectionType==1){
        // 全部\视频要更新数据
        [_xsVideoCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
        [_allCollectionV xsCollectionViewUpdataMaterialWithId:model.Id withIsSelectModel:model.isSelectModel];
    }
    
}

//collectionType;// 0全部 3图片 1视频
- (void)bossIPUniappVuePageUploadImageOrVideoSuccessfulWith:(NSInteger)collectionType{
    
    
    if(collectionType==3){//图片
        
        // 说明上传的是图片 刷新图片 和全部
        [_xsImgCollectionV collectionVBossIPUniappVuePageUploadImageOrVideoSuccessfulWith:collectionType];
    }
    else if(collectionType==1){//视频
        // 说明上传的是视频 刷新视频 和全部
        [_xsVideoCollectionV collectionVBossIPUniappVuePageUploadImageOrVideoSuccessfulWith:collectionType];
    }
    
    [_allCollectionV collectionVBossIPUniappVuePageUploadImageOrVideoSuccessfulWith:collectionType];
}

// 删除成功后vue传递过来删除的Id
- (void)xsSelectAddMaterialVUniappVueDeleteMaterialSuccessWithId:(NSInteger)Id{
    
    [_xsImgCollectionV xsSelectAddMaterialCollectionVUniappVueDeleteMaterialSuccessWithId:Id];
    [_xsVideoCollectionV xsSelectAddMaterialCollectionVUniappVueDeleteMaterialSuccessWithId:Id];
    [_allCollectionV xsSelectAddMaterialCollectionVUniappVueDeleteMaterialSuccessWithId:Id];
}

// 设置 全部 图片  视频collectionview的数据全部修改为为选中
- (void)xsUpdateAllImageVideoModelToNotSelect{
    
    [_allCollectionV xsUpdateCollectionViewAllImageVideoModelToNotSelect];
    [_xsImgCollectionV xsUpdateCollectionViewAllImageVideoModelToNotSelect];
    [_xsVideoCollectionV xsUpdateCollectionViewAllImageVideoModelToNotSelect];
    
}

@end
